import request from '/@/utils/request'
import { IAddUser } from '/@/entity/staff'

export const defaultAddUserData: IAddUser = {
	face: '', //员工人脸
	userName: '', //姓名
	realName: '', //别称
	phone: '', //手机号
	sex: 1,
	isManagement: 1,
	roles: [], //角色ID数组
	state: 1, //是否在职
	account: '',
	pwd: ''
}

//----------------------------------------员工管理---------------------

// 获取所有用户列表
export const getSysUserList = (params: any): any =>
	request({
		url: '/auth/getSysUserList',
		method: 'get',
		params: params
	})

// 根据id获取户信息
export const getSysUserByUserId = (params: any): any =>
	request({
		url: '/auth/getSysUserByUserId',
		method: 'get',
		params: params
	})

// 新增用户
export const addSysUser = (params: any): any =>
	request({
		url: '/auth/addSysUser',
		method: 'POST',
		params: params
	})

// 更新用户
export const updateSysUser = (params: any): any =>
	request({
		url: '/auth/updateSysUser',
		method: 'POST',
		params: params
	})
